<script type="text/javascript">
<!-- // <![CDATA[ -->
$(function() {
	<?php if (!empty($this->request['section'])): ?>
	//$.scrollTo("#<?=$this->request['section']?>").show();
	$.scrollTo($('#<?=$this->request['section']?>'), 0, { offset: -20 });
	<?php endif ?>
});
</script>
<!-- ]]> -->
<?php echo $this->form; ?>


<!--  OVERLAYS / PREPROCESSOR -->

<div id="X-browse-constructions" style="display: none;" title="Selezione struttura opaca">
	<div class="widget widget-table">
		<div class="widget-header">
			<span class="icon-layers"></span>
		</div>
		<div class="widget-content">
			<table id="dt_constructions">
				<thead>
					<tr>
						<th>Struttura</th>
						<th>Categoria</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($this->constructions as $constr): ?>
					<tr>
						<td class="construction_name">
						<a href="javascript:void(0)" onclick="doUpdateSelection('<?=$constr->id; ?>', '<?=$constr->name; ?>');"><?php echo $constr->name; ?></a>
						</td>
						<td class="construction_category">
						<?php echo $constr->findParentRow('ConstructionCategories') ? $constr->findParentRow('ConstructionCategories')->name : 'N/A' ; ?>
						</td>
					</tr>
					<?php endforeach; ?>
				</tbody>
				<tfoot>
					<tr>
					<th>&nbsp;</th>
					<th><!-- label for="filter_construction_category">Filtra per categoria</label -->
					<form class="form uniformForm">
						<div class="field-group">
							<div class="field">
								<select name="filter_construction_category" id="filter_construction_category">
									<option value="">Tutte</option>
									<option value="N/A">Non categorizzate</option>
									<?php foreach ($this->construction_categories as $cat): ?>
									<option value="<?=$cat['name']?>"><?=$cat['name']?></option>
									<?php endforeach; ?>
								</select>
								<label for="filter_construction_category">Filtra per categoria</label>
							</div>
						</div>
					</form>
					</th>
					</tr>
				</tfoot>
			</table>
		</div>
	</div>
</div>

<div id="X-browse-glazings" style="display: none;" title="Selezione struttura trasparente">
	<div class="widget widget-table">
		<div class="widget-header">
			<span class="icon-layers"></span>
		</div>
		<div class="widget-content">
			<table id="dt_glazings">
				<thead>
					<tr>
						<th>Struttura</th>
						<th>Categoria</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($this->glazings as $glaze): ?>
					<tr>
						<td class="glazing_name">
						<a href="javascript:void(0)" onclick="doUpdateSelection('<?=$glaze->id; ?>', '<?=$glaze->name; ?>');"><?php echo $glaze->name; ?></a>
						</td>
						<td class="glazing_category">
						<?php echo $glaze->findParentRow('GlazingCategories') ? $glaze->findParentRow('GlazingCategories')->name : 'N/A' ; ?>
						</td>
					</tr>
					<?php endforeach; ?>
				</tbody>
				<tfoot>
					<tr>
					<th>&nbsp;</th>
					<th><!-- label for="filter_glazing_category">Filtra per categoria</label -->
					<form class="form uniformForm">
						<div class="field-group">
							<div class="field">
								<select name="filter_glazing_category" id="filter_glazing_category">
									<option value="">Tutte</option>
									<option value="N/A">Non categorizzate</option>
									<?php foreach ($this->glazing_categories as $cat): ?>
									<option value="<?=$cat['name']?>"><?=$cat['name']?></option>
									<?php endforeach; ?>
								</select>
								<label for="filter_glazing_category">Filtra per categoria</label>
							</div>
						</div>
					</form>
					</th>
					</tr>
				</tfoot>
			</table>
		</div>
	</div>
</div> 

